package com.lin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lin.mapper.PDpatchMapper;
import com.lin.pojo.MApply;
import com.lin.pojo.PageVo;
import com.lin.service.PDpatchService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class PDpatchServiceImpl extends ServiceImpl<PDpatchMapper, MApply> implements PDpatchService{
    @Autowired
    PDpatchMapper pDpatchMapper;

    @Override
    public PageVo<MApply> queryAuditingByCond(MApply mApply, int pageno, int pagesize) {
        PageHelper.startPage(pageno,pagesize);
        //连表条件查询
        List<MApply> list1=pDpatchMapper.queryAuditingByCond(mApply);
        PageInfo<MApply> page1=new PageInfo<MApply>(list1);
        PageVo<MApply> pageVo = new PageVo<MApply>();
        pageVo.setTotal(page1.getTotal());
        pageVo.setRows(page1.getList());
        return pageVo;
    }

    @Override
    public MApply queryAllAuditingById(MApply mApply) {
        return pDpatchMapper.queryAllAuditingById(mApply);
    }

    @Override
    public int AuditPassByCheckTag(String applyId) {
        return  pDpatchMapper.AuditPassByCheckTag(applyId);
    }
}
